﻿@using ReportViewerForMvc;
@using Apps.Web.Core;
@using Apps.Locale;
@{
    ViewBag.Title = "自采煤台账";
    Layout = "~/Views/Shared/_Index_Layout.cshtml";
}
<script src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
<script src="~/Scripts/common.js"></script>
<form id="form1">
    <div class="mvctool">
        <select class="easyui-combobox" name="TYPE_ID" id="TYPE_ID" style="width:250px;"></select>
        <input type="text" class="input Wdate" style="width:105px" name="STime" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', maxDate: '#F{$dp.$D(\'ETime\')}' })" id="STime" value="@ViewBag.STime" placeholder="开始日期">
        <input type="text" class="input Wdate" style="width:105px" name="ETime" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: '#F{$dp.$D(\'STime\')}' })" id="ETime" value="@ViewBag.ETime" placeholder="结束日期">
        @Html.ToolButton("btnQuery", "fa fa-search", Resource.Query, "Query", true)
    </div>
</form>

@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, new { @id = "mainiframe", @width = "100%", @height = "100%", onload = "changeFrameHeight()" }, "CaculateReportWebForm")

<script type="text/javascript">
    function changeFrameHeight() {
        var ifm = document.getElementById("mainiframe");
        ifm.height = document.documentElement.clientHeight-50;
    }
    $(function () {
        window.onresize = function () {
            changeFrameHeight();
        }

         $.ajax({
            url: '../../RC/SAMPLING/GetTranSuppList?type=4',
            type: 'post',
            dataType: 'json',
            success: function (result) {
                $('#TYPE_ID').combobox({
                    data: result,
                    valueField: 'Value',
                    textField: 'Text',
                    onLoadSuccess: function () {

                    }
                });
            },
        });
    });

    $("#btnQuery").click(function () {
        $("#form1").submit();
    });

</script>